package net.internet;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.InetAddress;
import java.util.Date;

public class Weblog
{
	public static void main(String[] args)
	{
		Date start = new Date();
		try
		{
			FileInputStream fin = new FileInputStream(args[0]);
			Reader in = new InputStreamReader(fin);
			BufferedReader bf = new BufferedReader(in);
			String entry = null;
			while((entry = bf.readLine())!=null)
			{
				int index = entry.indexOf(' ',0);
				String ip = entry.substring(0,index);
				String theRest = entry.substring(index,entry.length());
				
				try
				{
					InetAddress address = InetAddress.getByName(ip);
					System.out.println(address.getHostName()+theRest);
				}
				catch (Exception e)
				{
				}
			}
		}
		catch (Exception e)
		{
		}
		Date end = new Date();
		long elapsedTime = end.getTime()-start.getTime();
		System.out.println(elapsedTime);
	}
}
